Skip to content

chore: golangci-lint linting fixes#107

Merged
Emyrk merged 5 commits into
mainfrom
stevenmasley/lint
May 5, 2025
Merged

chore: golangci-lint linting fixes#107
Emyrk merged 5 commits into
mainfrom
stevenmasley/lint

Conversation

@Emyrk
Copy link
Copy Markdown
Member

@Emyrk Emyrk commented May 5, 2025

No description provided.

@Emyrk Emyrk changed the title Stevenmasley/lint chore: golangci-lint linting fixes May 5, 2025
@Emyrk Emyrk requested a review from aslilac May 5, 2025 21:47
Comment thread scripts/rules.go
Comment on lines +23 to +35
func asStringsIsDangerous(m dsl.Matcher) {
m.Import("github.com/zclconf/go-cty/cty")

m.Match(
`$v.AsString()`,
).
Where(
m["v"].Type.Is("cty.Value") &&
// Ignore unit tests
!m.File().Name.Matches(`_test\.go$`),
).
Report("'AsStrings()' can result in a panic if the type is not known. Ignore this linter with caution")
}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm adding this. If misused it is an easy panic. I might continue to add these kinds of "be careful" cty stuff

Copy link
Copy Markdown
Member

@aslilac aslilac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather remove a bunch of this commented out code than leave it, but I'll defer to you on if you wanna take the opportunity now or not

Comment thread cli/clidisplay/resources.go Outdated
Comment thread cli/env.go
Comment thread cli/plan.go Outdated
Comment thread cmd/preview/main.go
Comment thread log.go Outdated
}))
var _ = ll
//tlog.SetDefault(ll)
// tlog.SetDefault(ll)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@Emyrk
Copy link
Copy Markdown
Member Author

Emyrk commented May 5, 2025

@aslilac I need to do a longer look for this dead code. I just missed the ones you commented on 👍

@Emyrk Emyrk merged commit bfd58e2 into main May 5, 2025
3 checks passed
@Emyrk Emyrk deleted the stevenmasley/lint branch May 15, 2025 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants